package com.leinao.constant;

/**
 *
 * @Description 文件中心错误码
 * @author lizi
 * @date 2018/10/17 上午11:15
 * @Version 1.0
 */
public enum FileErrorEnum {
    FILE_EXIST(10000, "file already exist"),   // 文件已经存在
    FILE_NOT_EXIST(10001, "file not exist"), // 文件不存在
    FILE_EMPTY(10002, "file is empty"), // 文件必传
    PARAM_ERROR(20000, "param error"), // 请求参数错误
    TOKEN_ERROR(30000, "token error"),   // Token无效
    DATA_GET_ERROR(30001, "get data failed"),   // 获取接口数据失败
    UNKNOWN_ERROR(30002, "unknown error"),   // 未知异常
    NO_AUTHORITY(30003, "no authority"), // 无权限

    // 仓库初始化失败
    REPOSITORY_INIT_FAILURE(30100, "repository init failure"),
    // 代码分支创建失败
    TAG_CREATE_FAILURE(30101, "tag create failure"),

    FILE_SIZE_ERROR(40000, "file size overflow max value"), // 文件超出大小限制
    FILE_UPLOAD_ERROR(40001, "file upload error"),// 文件上传失败
    FILE_DOWNLOAD_ERROR(40002, "file download error"),// 文件下载失败
    FILE_ACCESS_DENIED(40003, "file access denied"), // 文件无权限操作
    FILE_CREATE_FAILURE(40004, "file create failure"), // 文件或文件夹创建失败
    FILE_READ_FAILURE(40005, "file read failure"), // 文件读取失败
    FILE_DELETE_FAILURE(40006, "file delete failure"), // 文件删除失败
    FILE_RENAME_FAILURE(40007, "file rename failure"), // 文件重命名失败
    FILE_COPY_FAILURE(40008, "file copy failure"), // 文件复制失败

    PROJECT_NO_AUTHORITY(30003, "project no authority"),   // 项目无权限
    PROJECT_ALREADY_PUBLIC(30004, "project already public"),   // 项目已经公开
    INVALID_PROJECT_ID(40006, "invalid projectId param"),   // 项目ID参数无效
    PROJECT_NOT_PUBLIC(40007, "project not public"),   // 项目非公开
    PROJECT_NOT_CONTAINS_FILE(40008, "project not contains file"),   // 项目没有代码
    INVALID_PROJECT_PUBLIC_JOB_ID(40009, "invalid projectPublicJobId param"),   // 公开任务ID参数无效
    INVALID_PROJECT_JOB_ID(40010, "invalid projectJobId param"),   // 个人任务ID参数无效
    INIT_PROJECT_CODE_FAILURE(40011, "init project code failure"),   // 初始化项目code下的.gitkeep文件失败
    PROJECT_CODE_SIZE_OVER_LIMIT(40012, "project code size over limit"),   // 项目代码大小超出限制

    INVALID_DATASET_NUMBER(20010, "invalid dataset number"),   // 数据集编号参数无效
    DATASET_NOT_CONTAINS_FILE(20011, "dataset not contains file"),   // 数据集没有文件内容

    // 项目迁移中，请修改参数或者等待
    PROJECT_IS_TRANSFERING(50000, "project is transfering"),
    FILE_TYPE_ERROR(50001, "file type is error"),
    ;

    private Integer seq;

    private String desc;

    FileErrorEnum(Integer seq, String desc) {
        this.seq = seq;
        this.desc = desc;
    }

    public int getSeq() {
        return seq;
    }

    public String getDesc() {
        return desc;
    }
}
